﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PaperFeedbackList.aspx.cs" Inherits="ExaminationSys.View.Paper.PaperFeedbackList" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<%@ Register src="PaperFeedbackEdit.ascx" tagname="PaperFeedbackEdit" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
 <script type="text/javascript">
     var template = '<span style="color:{0};">{1}</span>';
     var TypeRaw = function (value) {
         switch (value) {
             case 1:
                 return Ext.String.format(template, "green", "按等分");
             case 2:
                 return Ext.String.format(template, "red", "按时间");
             default:
                 return Ext.String.format(template, "red", "其它");
         }
     };
 </script>
</head>

<body>
    <form id="Form1" runat="server">
    <input type="hidden" id="HidPaperFeedBackCommentId" runat="server" />
        <ext:ResourceManager ID="ResourceManager1" runat="server"  DirectMethodNamespace="X" />
        
         <ext:Store ID="StorePaperFeedback"
            runat="server" PageSize="20"
            ShowWarningOnFailure="true"
            AutoLoad="true"
            OnReadData="PaperFeedback_RefreshData">
            <Proxy>
                <ext:PageProxy>                    
                    <Listeners>
                        <Exception Handler="Ext.MessageBox.alert('Load failed', response.statusText);" />
                    </Listeners>
                </ext:PageProxy>
            </Proxy>
            <Model>
                <ext:Model ID="PaperFeedbackModel" runat="server" IDProperty="ID">
                    <Fields>
                        <ext:ModelField Name="ID"/>
                        <ext:ModelField Name="StartValue" Type="Int" />
                        <ext:ModelField Name="EndValue" Type="Int" />
                        <ext:ModelField Name="Comment" />
                        <ext:ModelField Name="Type" />
                        <ext:ModelField Name="OrderIndex"/>
                        <ext:ModelField Name="Status" Type="Int" />
                        <ext:ModelField Name="Operator" />
                        <ext:ModelField Name="OperatorTime" />
                    </Fields>
                </ext:Model>
            </Model>
            <AutoLoadParams>
                <ext:Parameter Name="start" Value="0" Mode="Raw" />
                <ext:Parameter Name="limit" Value="20" Mode="Raw" />
            </AutoLoadParams>            
            <Sorters>
                <ext:DataSorter Property="OpeatorTime" Direction="DESC" />
            </Sorters>
            <Listeners>
                <Exception Handler="Ext.MessageBox.alert('Load failed', response.statusText);"></Exception>
            </Listeners>
        </ext:Store>
         <ext:ViewPort ID="ViewPort1"  runat="server" Layout="BorderLayout" >
        <Items>
        
				<%--Split="true"--%>
        <ext:Panel>
        
        </ext:Panel>
        <ext:GridPanel 
            ID="GridPanelPaperFeedback" 
            runat="server" 
             Region="Center"
            StoreID="StorePaperFeedback"             
            TrackMouseOver="true"
            AutoExpandColumn="Title"
            >

            <TopBar>
               <%--  <ext:Toolbar ID="Toolbar2"  runat="server">
                    <Items>
                       
                        <ext:Button ID="Button1" runat="server" Text="栏目管理" Icon="Add">
                        <DirectEvents>
                            <Click OnEvent="Add_Click"></Click>
                        </DirectEvents>
                        </ext:Button>
                        <ext:DisplayField ID="DisplayField2" runat="server" Text="->" Cls="dot-label" />
                        <ext:Button ID="Button2" runat="server" Text="栏目管理" Icon="GroupDelete">
                          <Listeners>
                            <Click Handler="X.DoConfirm()" />
                        </Listeners>
                        </ext:Button>
                         <ext:DisplayField ID="DisplayField1" runat="server" Text="->" Cls="dot-label" />
                        <ext:Button ID="Button3" runat="server" Text="动机测试" Icon="LockKey">
                        <DirectEvents>
                            <Click OnEvent="BatchLock_Click"></Click>
                        </DirectEvents>
                        </ext:Button>
                    </Items>
                </ext:Toolbar>--%>
                <ext:Toolbar ID="Toolbar1"  runat="server">
                    <Items>
                        <ext:Label ID="lblTitile" Text="标题:" runat="server"></ext:Label>
                        <ext:TextField ID="textTitle"  EmptyText="请先输入评语标题" runat="server" Width="240"></ext:TextField>
                        <ext:Button ID="BtnAdd" runat="server" Text="新增" Icon="Add">
                        <DirectEvents>
                            <Click OnEvent="Add_Click"></Click>
                        </DirectEvents>
                        </ext:Button>
                        <ext:Button ID="BtnBatchDelete" runat="server" Text="批量删除" Icon="GroupDelete">
                          <Listeners>
                            <Click Handler="X.DoConfirm()" />
                        </Listeners>
                       <%-- <DirectEvents>
                            <Click OnEvent="BatchDelete_Click"></Click>
                        </DirectEvents>--%>
                        </ext:Button>
                     <%--   <ext:Button ID="BtnBatchLock" runat="server" Text="批量锁定" Icon="LockKey">
                        <DirectEvents>
                            <Click OnEvent="BatchLock_Click"></Click>
                        </DirectEvents>
                        </ext:Button>--%>
                        <ext:ToolbarSeparator/>
                        <ext:TextField ID="GroupSearchText"  EmptyText="输入关键字" runat="server"></ext:TextField>
                        <ext:Button runat="server" ID="BtnGroupFind" Text="查找" Icon="Find" >                           
                               <DirectEvents>
                            <Click OnEvent="BtnGroupFind_Click"></Click>
                            </DirectEvents>                        
                        </ext:Button>                                         
                        <ext:ToolbarSeparator/>                 
                        <ext:Button runat="server" ID="BtnRefresh" Text="刷新" Icon="ArrowRefresh" >                           
                               <Listeners>
                                    <Click Handler="#{StorePaperFeedback}.reload();"  />
                                </Listeners>                          
                        </ext:Button>
                        <ext:Button ID="btnBacktoComment" runat="server" Text="返回评语管理" Icon="PageBack"> 
                            <DirectEvents>
                                <Click OnEvent="Btn_GoBack" ></Click>
                            </DirectEvents>
                        </ext:Button>
                    </Items>
                </ext:Toolbar>
            </TopBar>
            <SelectionModel> 
             <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1"  runat="server" Mode="Multi" CheckOnly="true" />
            </SelectionModel>
            <ColumnModel ID="ColumnModel1" runat="server">
			    <Columns>
                    <ext:Column ID="Column1" runat="server" Header="ID" DataIndex="ID" Width="150" Hidden="true" />
                      <ext:Column ID="Column4"  runat="server" Header="编号" DataIndex="OrderIndex" Width="100" />
                    <ext:Column ID="Column2"  runat="server" Header="开始值" DataIndex="StartValue" Width="100" />
                    <ext:Column ID="Column5"  runat="server" Header="结束值" DataIndex="EndValue" Width="100" />
                    <ext:Column ID="Column6"  runat="server" Header="标准" DataIndex="Type" Width="100" >
                      <Renderer Fn="TypeRaw" />
                    </ext:Column>
                    <ext:Column ID="Column3"  runat="server" Header="评语建议" DataIndex="Comment" Width="220" />
                    <ext:CommandColumn ID="CommandColumn1"  runat="server" Width="120" >
                        <Commands >
                            <ext:GridCommand Icon="NoteEdit" CommandName="Edit" Text="编辑" />   
                            <ext:GridCommand Icon="Delete"  CommandName="Delete" Text="删除" />                         
                        </Commands>             
                        <DirectEvents>
                            <Command OnEvent="Command">
                                <ExtraParams>
                                     <ext:Parameter Name="Id" Value="record.getId()" Mode="Raw" />
                                     <ext:Parameter Name="command" Value="command" Mode="Raw" />
                                </ExtraParams>
                               <Confirmation BeforeConfirm="if (command=='Edit') return false;" ConfirmRequest="true" Message="是否删除该记录?" Title="提示" />
                            </Command>
                        </DirectEvents>
                    </ext:CommandColumn>
			    </Columns>
                
            </ColumnModel>
            <Listeners>
            </Listeners> 
            <View>
                <ext:GridView ID="GridView1"  runat="server" />
            </View>    
            <BottomBar>
                <ext:PagingToolbar ID="PagingToolbar1" 
                    runat="server"                      
                    DisplayInfo="true" 
                    DisplayMsg="当前显示记录: {0} - {1}  共计: {2}" 
                    EmptyMsg="没有记录可以显示" 
                    
                    />
            </BottomBar>
        </ext:GridPanel>
        </Items>
        </ext:ViewPort>
        <uc1:PaperFeedbackEdit ID="PaperFeedbackEditWindow" runat="server" />

    </form>
</body>
</html>
